<template>
<!--index.wxml-->

  <view class="container">
    <view class="swiper-box">
      <view class="nickname-box">
        <view class="nickname">
         
          <view style="margin-bottom:30px;">{{biaoti}}</view>
         
        </view>
      </view>
      <image src="/static/images/bg@2x.png" class="backimg"></image>
     
    </view>
    <view class="list-mine">
      <view class="inner">
        <view class="inner-title">
          <image src="/static/images/round.png" style="width:17px;height:17px;margin-right:5px;"></image>
          <view>{{title}}</view>
        </view>
        <rich-text :nodes="text"></rich-text>
      </view>
    </view>
   
  </view>
</template>

<script>
//index.js
const app = getApp().globalData;
import iTabBar from "../../dist/tab-bar/index";
import iTabBarItem from "../../dist/tab-bar-item/index";
import iCard from "../../dist/card/index";
import iCellGroup from "../../dist/cell-group/index";
import iCell from "../../dist/cell/index";
import iGrid from "../../dist/grid/index";
import iGridItem from "../../dist/grid-item/index";
import iGridIcon from "../../dist/grid-icon/index";
import iGridLabel from "../../dist/grid-label/index";
import { getArticel } from "@/api/setting.js"

export default {
  data() {
    return {
      text: '',
      biaoti: "",
      title: ""
    };
  },

  components: {
    iTabBar,
    iTabBarItem,
    iCard,
    iCellGroup,
    iCell,
    iGrid,
    iGridItem,
    iGridIcon,
    iGridLabel
  },
  props: {},
  onLoad: function (options) {
    if (options.cate == 8) {
      this.get_inner(8);
	  this.biaoti = "产品介绍"
    }
    
    if (options.cate == 121) {
      this.get_inner(121);
	  this.biaoti = "公司介绍"
    }
	
    
  
   
  },
  methods: {
    get_inner: function (id) {
      var _this = this;
		getArticel({
			cate_id: id
		}).then(res => {
			console.log(res,'get_articel');
			
			if (res.code == 1) {
				console.log(res.data.data)
				_this.text = res.data.data ? res.data.data[0].article_content : ''
				_this.title = res.data.data ? res.data.data[0].article_title : ''
				console.log(_this.text,_this.title,'1111')
			  
			}
		})
     //  uni.request({
     //    url: app.post_url + '/api/v1/get_articel',
     //    //仅为示例，并非真实的接口地址
     //    data: {
     //      cate_id: id
     //    },
     //    method: 'post',

     //    success(res) {
     //      console.log(res);

     //      if (res.data.code == 1) {
			  // _this.text = res.data.data ? res.data.data.data[0].article_content : ''
			  // _this.title = res.data.data ? res.data.data.data[0].article_title : ''
            
     //      }
     //    }

     //  });
    }
  }
};
</script>
<style>
@import "./index.css";
</style>